<template>
	<view class="content">
		<image src="/static/suc.png" mode=""></image>
		<view class="t1">
			支付成功
		</view>
		<view class="dec">
			<text>支付方式：微信支付</text>
			<text>支付时间：{{currentTime}}</text>
		</view>
		<view class="btn" @click="handleToOrder">
			查看订单
		</view>
	</view>
</template>

<script>
	export default{
		data(){
			return{
				currentTime:'',
				orderSn:''
			}
		},
		onLoad(option) {
			this.orderSn = option.orderSn
			this.getCurrentTime()
		},
		methods:{
			getCurrentTime() {
				// 创建 Date 对象获取当前时间
				const date = new Date();
				// 获取年份
				const year = date.getFullYear();
				// 获取月份（注意：月份从 0 开始，所以要加 1）
				const month = String(date.getMonth() + 1).padStart(2, '0');
				// 获取日期
				const day = String(date.getDate()).padStart(2, '0');
				// 获取小时
				const hours = String(date.getHours()).padStart(2, '0');
				// 获取分钟
				const minutes = String(date.getMinutes()).padStart(2, '0');
				// 获取秒数
				const seconds = String(date.getSeconds()).padStart(2, '0');
				// 格式化时间
				this.currentTime = `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
			},
			handleToOrder(){
				uni.reLaunch({
					url:`/pagesA/group/result?id=${this.orderSn}`
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.content{
		padding-top: 180rpx;
		image{
			display: block;
			width: 86rpx;
			height: 86rpx;
			margin: 0 auto;
		}
		.t1{
			font-size: 40rpx;
			text-align: center;
			margin-top: 40rpx;
		}
		.dec{
			margin-top: 48rpx;
			text-align: center;
			text{
				font-size: 24rpx;
				display: block;
				text-align: center;
				color: #999999;
				line-height: 46rpx;
			}
		}
		.btn{
			width: 300rpx;
			height: 80rpx;
			background: #020202;
			border-radius: 50rpx;
			text-align: center;
			line-height: 80rpx;
			color: #fff;
			font-size: 24rpx;
			margin: 0 auto;
			margin-top: 70rpx;
		}
	}
</style>